#include <iostream>
using std::cout;
using std::endl;

class Base {
protected:
	Base(int base)
    : _base(base) 
    { 
        cout << "Base()" << endl; 
    }

	int _base;
};

class Derived
: public Base 
{
public:
	Derived(int base, int derived)
	: Base(base)
	, _derived(derived)
    /* , _b1(base)//error,Base对象不能作为成员子对象 */
	{ cout << "Derived(int,int)" << endl; }
    
	void print() const
	{
		cout << "_base:" << _base
		<< ", _derived:" << _derived << endl;
	}
private:
	int _derived;
    /* Base _b1; */
};

#if 0
class Test
{
public:
    Test(int x)
    : _b1(x)
    {}
private:
    Base _b1;
};
#endif

void test0(){
    /* Base base(10); */
    Derived d1(2,5);
    Base * pb = &d1;
}

int main(void){
    test0();
    return 0;
}
